const mongoose = require("mongoose");

const discountCouponSchema = new mongoose.Schema(
  {
    occasionName: {
      type: String,
      required: true,
      trim: true,
    },
    couponCode: {
      type: String,
      required: true,
      unique: true, // ensure no duplicates
      trim: true,
    },
    expiryDate: {
      type: Date,
      required: true,
    },
    value: {
      type: Number,
      required: true,
    },
    couponType: {
      type: String,
      enum: ["percentage", "value"],
      default: "value",
    },
    description: {
      type: String,
      default: "",
    },
    status: {
      type: String,
      enum: ["Active", "Inactive"],
      default: "Active",
    },
  },
  { timestamps: true }
);

module.exports = mongoose.model("DiscountCoupon", discountCouponSchema);